// $Id: main.menu,v 1.1.2.4 2004/07/06 19:34:07 fretn Exp $

#include "ui/menudef.h"

// Defines //

#define WINDOW_X		16
#define WINDOW_Y		16
#define WINDOW_WIDTH	128
#define WINDOW_HEIGHT	248
#define GROUP_NAME		"grpMain"

// Macros //

#include "ui/menumacros.h"
	
// Opener //

menuDef {
	name		"main_opener"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	
	onOpen {
		open fadebox_black ;
		open background_1 ;
		setmenuitemcolor fadebox_black fadebox backcolor 0 0 0 1 ;
		fadeoutmenu fadebox_black ;
		open main ;
		clearcvar ui_profile_create_error ;
		close main_opener ;
	}
}

// Main Menu //

menuDef {
	name		"main"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED
  
	onOpen {
//		setitemcolor fadebox backcolor 0 0 0 1 ;
//		uiScript stopRefresh ;
//		
		conditionalscript cl_profile 1
			( "clearFocus" )
			( "close main ; open profile_create_initial_opener" )	// do we want an abort here?

		// ydnar
		conditionalscript ROldModeCheck 2
			( "clearFocus ; open vid_confirm" )
			( "clearFocus" )

		conditionalscript cl_autoupdate 1
			( "checkautoupdate" )
			( "clearFocus" )
	}
	
	onEsc {
		clearFocus ;
		open quit
	}

// Background Logo //
	
	itemDef {
		name		"et_logo"
		rect		104 124 400 200		// 16, 16 offset!!
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/et_logo_huge"
		visible		1
		decoration
	}

// Company Logos //

	/*itemDef {
		name		"id_logo"
		rect		0 400 48 48		// 16, 16 offset!!
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/logo_id_dark"
		forecolor	1 1 1 1
		visible		1
		decoration
	}
	
	itemDef {
		name		"atvi_logo"
		rect		52 421 108 27		// 16, 16 offset!! (note offset to left a little as well)
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/logo_atvi_dark"
		forecolor	1 1 1 1
		visible		1
		decoration
	}

	itemDef {
		name		"sd_logo"
		rect		$evalfloat(640-(2*WINDOW_X)-48) 400 48 48		// 16, 16 offset!!
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/logo_sd_dark"
		forecolor	1 1 1 1
		visible		1
		decoration
	}*/
	
	itemDef {
		name		"sd_logo"
		rect		4 394 54 54		// 16, 16 offset!!
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/logo_sd_dark"
		forecolor	1 1 1 1
		visible		1
		decoration
	}

	// rain
	itemDef {
		name		"etpro_logo"
		rect		74 394 54 54
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/logo_etpro"
		forecolor	1 1 1 0.25
		visible		1
		decoration
	}
	
	itemDef {
		name		"atvi_logo"
		rect		$evalfloat(640-(2*WINDOW_X)-48-4-108) 421 108 27		// 16, 16 offset!! (note offset to left a little as well)
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/logo_atvi_dark"
		forecolor	1 1 1 1
		visible		1
		decoration
	}
	
	itemDef {
		name		"id_logo"
		rect		$evalfloat(640-(2*WINDOW_X)-48) 400 48 48		// 16, 16 offset!!
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/logo_id_dark"
		forecolor	1 1 1 1
		visible		1
		decoration
	}


// Window //

	WINDOW( "MAIN", 50 )
	
// Buttons //

	BUTTON( 6, 32, WINDOW_WIDTH-12, 18, "PLAY ONLINE", .3, 14, close main ; /*close backgroundmusic ; open backgroundmusic_server ;*/ uiScript UpdateFilter ; uiScript ServerSortDown 4 ; open playonline )
	BUTTON( 6, 56, WINDOW_WIDTH-12, 18, "HOST GAME", .3, 14, close main ; /*close backgroundmusic ; open backgroundmusic_server ;*/ uiScript loadArenas ; uiScript initHostGameFeatures ; open hostgame )
	BUTTON( 6, 80, WINDOW_WIDTH-12, 18, "REPLAYS", .3, 14, close main ; open viewreplay )
	BUTTON( 6, 104, WINDOW_WIDTH-12, 18, "OPTIONS", .3, 14, close main ; open options )
// rain - et pro options from main menu
// 2good i need the etpro cvar to know from witch 'MAINMENU'it is opened
	BUTTON( 6, 128, WINDOW_WIDTH-12, 18, "ET PRO", .3, 14, close main ; open etpro_menu_main ; setcvar etpro_menu_ingame 0 )
	BUTTON( 6, 152, WINDOW_WIDTH-12, 18, "PROFILE", .3, 14, close main ; open profile )
// rain - start out with etpro credits
	BUTTON( 6, 176, WINDOW_WIDTH-12, 18, "CREDITS", .3, 14, close main ; open credits_etpro )
// rain - revive 'MODS' menu
	BUTTON( 6, 200, WINDOW_WIDTH-12, 18, "MODS", .3, 14, close main ; open mods )
	BUTTON( 6, 224, WINDOW_WIDTH-12, 18, "EXIT GAME", .3, 14, clearFocus ; open quit )
}
